/*
$nav-color: #F90;
nav {
  $width: 100px;
  width: $width;
  color: $nav-color;
}
*/
//------------------------------------------------------------------------------------------------------------------------------------------- 全局变量
$workbench-header-height: 30px;
$workbench-footer-height: 22px;
$body-background-color: rgb(30, 30, 30);
$body-font-family: Segoe WPC,Segoe UI,Microsoft YaHei,sans-serif;
$body-font-size: 12px;
$tools-background-color: rgba(128, 128, 128, 0.2);
$title-background-color: rgb(30, 30, 30);
$title-color: rgba(204, 204, 204, 0.5);
// $gutter-background-color: rgb(28, 28, 29);
$gutter-background-color: rgb(30, 30, 30);
$gutter-vertical-background-color: rgba(128, 128, 128, 0.35);
$left-background-color: rgb(37, 37, 38);
$center-background-color: rgb(30, 30, 30);
$editor-tools-height: 35px;
$editor-tools-background-color: rgb(37, 37, 38);
$panel-tools-background-color: rgba(128, 128, 128, 0.2);
$panel-tools-color: rgb(204, 204, 204);
$panel-tools-height: 22px;
$panel-content-min-height: 48px;

//------------------------------------------------------------------------------------------------------------------------------------------- 页面布局样式
body {
  // border-top: 1px solid #ccc;
  background-color: $body-background-color;
  font-family: $body-font-family;
  font-size: $body-font-size;
  user-select: none;
}

.show-container-left {
  display: none;
  cursor: pointer;
  position: absolute;
  top: 80px;
  left: -6px;
  // display: inline-block;
  width: 32px;
  height: 24px;
  background-color: rgb(25, 25, 25);
  border-radius: 0 8px 8px 0;
  border-top: 1px solid rgb(37, 37, 38);
  border-right: 1px solid rgb(37, 37, 38);
  border-bottom: 1px solid rgb(37, 37, 38);
  box-shadow: 0 0 1px rgb(37, 37, 38);
  z-index: 9999999;
  background-position-x: 60%;
  background-position-y: 50%;
  background-repeat: no-repeat;
  // background-image: url(../../assets/images/vscode-icons/dark/arrow-right.svg);
  background-image: url(../../assets/images/vscode-icons/dark/folder.svg);
  background-size: 18px;
  &:hover {
    box-shadow: 0 0 3px rgb(37, 37, 38);
    left: -2px;
  }
  &:active {
    background-size: 20px;
  }
}

// 整体布局
.workbench-root {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  min-width: 1200px;
  min-height: 500px;

  // 顶部工具栏
  .workbench-header {
    width: 100%;
    height: $workbench-header-height;
    background-color: $tools-background-color;
  }

  // 底部工具栏
  .workbench-footer {
    width: 100%;
    height: $workbench-footer-height;
    background-color: rgb(0, 122, 204);
    color: rgb(255, 255, 255);
    line-height: 22px;
  }

  // 主内容区
  .workbench-container {
    width: 100%;
    height: calc(100% - #{$workbench-header-height + $workbench-footer-height});

    // 左边
    .container-left {
      float: left;
      height: 100%;
      width: 100%;
      background-color: $left-background-color;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      flex-wrap: nowrap;
      align-items: flex-start;
      .left-title {
        flex-shrink: 0;
        width: 100%;
        color: $title-color;
        background-color: $title-background-color;
        height: $editor-tools-height;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        .title {
          line-height: 35px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          padding-left: 12px;
        }
        .actions {
          padding-right: 8px;
          flex-grow: 2;
          display: flex;
          flex-direction: row;
          flex-wrap: nowrap;
          align-items: center;
          justify-content: flex-end;
          .button {
            cursor: pointer;
            display: inline-block;
            width: 28px;
            height: $panel-tools-height;
            background-position: 50%;
            background-repeat: no-repeat;
            &:active {
              background-size: 18px;
            }
            &.close {
              background-image: url(../../assets/images/vscode-icons/dark/close.svg);
            }
          }
        }
      }
      .opened-file {
        width: 100%;
        flex-shrink: 0;
        overflow: hidden;
      }
      .workspace {
        width: 100%;
        flex-grow: 2;
        flex-shrink: 2;
        overflow: hidden;
      }
      .switch-workspace {
        width: 100%;
        flex-shrink: 0;
        overflow: hidden;
      }
    }

    // 左边/中间 - 调节div
    .gutter.gutter-horizontal {
      float: left;
      // margin-top: $editor-tools-height;
      // height: calc(100% - #{$editor-tools-height});
      height: 100%;
      background-color: $gutter-background-color;
      cursor: ew-resize;
      // box-shadow: 0 1px 2px rgb(0, 0, 0);
    }

    // 中间
    .container-center {
      float: left;
      height: 100%;
      background-color: $center-background-color;

      // 编辑器区
      .editor-container {
        width: 100%;
        color: $title-color;
        // 未打开编辑器显示的页面
        .page-content {
          width: 100%;
          text-align: center;
          padding-top: 210px;
          font-size: 26px;
        }
        // 编辑文件页签-工具栏
        .editor-tools {
          height: $editor-tools-height;
          background-color: $editor-tools-background-color;
          border-bottom: 1px solid rgb(68, 68, 68);
        }
        // 编辑器实例
        .editor-instance {
          width: 100%;
          height: calc(100% - #{$editor-tools-height + 1px});
          overflow-x: hidden;
          overflow-y: hidden;
        }
      }

      // 编辑器区/控制台区 - 调节div
      .gutter.gutter-vertical {
        width: 100%;
        background-color: $gutter-vertical-background-color;
        cursor: ns-resize;
      }

      // 控制台区
      .console-container {
        width: 100%;
        height: 100%;

        .console-top-tools {
          border-bottom: 1px solid rgb(90, 90, 90);
          width: 100%;
          height: $editor-tools-height - 1px;
        }

        .v-console-container {
          width: 100%;
          height: calc(100% - #{$editor-tools-height});
          .v-console-tools {
            float: left;
            height: 100%;
            width: 24px;
          }
          #vConsoleByDebug {
            border-left: 1px solid rgb(90, 90, 90);
            float: left;
            user-select: text;
            height: 100%;
            width: calc(100% - 25px);
          }
        }
      }
    }
  }
}

//------------------------------------------------------------------------------------------------------------------------------------------- 组件通用样式
// panel 布局样式
.workbench-root {
  .panel {
    overflow: hidden;
    cursor: pointer;

    .panel-tools {
      display: flex;
      flex-direction: row;
      align-items: center;
      height: $panel-tools-height;
      font-size: 10px;
      font-weight: bold;
      line-height: $panel-tools-height;
      color: $panel-tools-color;
      background-color: $panel-tools-background-color;
      padding-left: 20px;
      background-image: url(../../assets/images/vscode-icons/dark/chevron-right.svg);
      background-position-x: 2px;
      background-position-y: 50%;
      background-repeat: no-repeat;

      &.expanded {
        background-image: url(../../assets/images/vscode-icons/dark/chevron-down.svg);
      }

      .title {
        display: inline-block;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
      }

      .actions {
        flex-grow: 2;
        display: none;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;

        .button {
          display: inline-block;
          width: 28px;
          height: $panel-tools-height;
          background-position: 50%;
          background-repeat: no-repeat;
          &:active {
            background-size: 18px;
          }
        }
      }
    }

    &:hover .panel-tools.expanded .actions {
      display: flex;
    }

    .panel-content {
      display: none;
      &.expanded {
        display: block;
        min-height: $panel-content-min-height;
      }
    }
  }
}

// 修改debug滚动条样式
#vConsoleByDebug .vc-content {
  overflow-y: auto;
  overflow-x: auto;
  // /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
  // &::-webkit-scrollbar{
  //   width: 8px;
  //   height: 8px;
  //   background-color:#F5F5F5;
  // }
  // /*定义滚动条轨道 内阴影+圆角*/
  // &::-webkit-scrollbar-track{
  //   -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
  //   border-radius: 10px;
  //   background-color:#F5F5F5;
  // }
  // /*定义滑块 内阴影+圆角*/
  // &::-webkit-scrollbar-thumb{
  //   border-radius: 10px;
  //   -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
  //   background-color:#555;
  // }
  &::-webkit-scrollbar {
    width: 12px;
    background-color: rgb(30, 30, 30);
  }
  &::-webkit-scrollbar-track {
    border-left: 1px solid rgb(57, 57, 57);
    background-color: rgb(30, 30, 30);
  }
  &::-webkit-scrollbar-thumb {
    display: none;
    background-color: rgb(66, 66, 66);
  }
  &:hover::-webkit-scrollbar-thumb {
    display: block;
  }
  .simplebar-track {
    color: rgb(36, 36, 36);
    background-color: rgb(36, 36, 36);
    &.simplebar-horizontal {
      width: 10px;
    }
    &.simplebar-vertical {
      width: 9px;
      border-left: 1px solid rgb(57, 57, 57);
    }
    .simplebar-scrollbar {
      width: 10px;
      right: 0;
      &:before {
        color: rgb(66, 66, 66);
        background-color: rgb(66, 66, 66);
        border-radius: 0;
        opacity: 1;
      }
    }
  }
}

//------------------------------------------------------------------------------------------------------------------------------------------- 模块具体样式
// 左边资源管理器
.workbench-root {
  .panel {
    &.opened-file {
      .panel-tools .actions {
        .save-all {
          background-image: url(../../assets/images/vscode-icons/dark/save-all.svg);
        }
        .close-all {
          background-image: url(../../assets/images/vscode-icons/dark/close-all.svg);
        }
      }
      .panel-content {
        overflow-x: hidden;
        overflow-y: auto;
        #opened-file-content {
          // padding-bottom: 12px;
          .file-title {
            cursor: pointer;
            overflow: hidden;
            display: flex;
            flex-direction: row;
            align-items: center;
            height: 22px;
            width: 100%;
            color: rgba(204, 204, 204, 0.8);
            background-color: rgb(37, 37, 38);
            .file-close {
              flex-shrink: 0;
              display: inline-block;
              width: 16px;
              height: 16px;
              margin: 0 5px 0 12px;
              background-position: 50%;
              background-repeat: no-repeat;
              &:active {
                background-size: 20px;
              }
              &.need-save {
                background-image: url(../../assets/images/vscode-icons/dark/circle-filled.svg) !important;
              }
            }
            .file-type {
              flex-shrink: 0;
              display: inline-block;
              margin-right: 2px;
              width: 16px;
              height: 16px;
              background-position: 50%;
              background-repeat: no-repeat;
              &.file-type-js {
                background-image: url(../../assets/images/vscode-icons/folder-file-type/file_type_js.svg);
              }
              &.file-type-json {
                background-image: url(../../assets/images/vscode-icons/folder-file-type/file_type_json.svg);
              }
            }
            .file-name {
              flex-shrink: 0;
              display: inline-block;
              white-space: nowrap;
              text-overflow: ellipsis;
              overflow: hidden;
              font-size: 12px;
              font-weight: bold;
              font-family:"Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif;
            }
            .file-full-path {
              flex-shrink: 2;
              flex-grow: 2;
              color: rgb(155, 156, 156);
              margin-left: 8px;
              display: inline-block;
              white-space: nowrap;
              text-overflow: ellipsis;
              overflow: hidden;
              font-size: 12px;
              font-weight: bold;
              font-family:"Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif;
            }
            &:hover {
              background-color: rgb(42, 45, 46);
              .file-close {
                background-image: url(../../assets/images/vscode-icons/dark/close.svg);
              }
            }
            &.active {
              color: rgb(233, 233, 233);
              background-color: rgb(55, 55, 61);
              .file-close {
                background-image: url(../../assets/images/vscode-icons/dark/close.svg);
              }
            }
          }
        }
        &.expanded {
          min-height: 110px !important;
          max-height: 220px !important;
        }
        &::-webkit-scrollbar {
          width: 10px;
          background-color: rgb(37, 37, 38);
        }
        &::-webkit-scrollbar-track {
          background-color: rgb(37, 37, 38);
        }
        &::-webkit-scrollbar-thumb {
          display: block;
          background-color: rgb(73, 75, 76);
        }
        .simplebar-track {
          &.simplebar-vertical {
            width: 10px;
          }
          .simplebar-scrollbar {
            width: 10px;
            right: 0;
            &:before {
              background-color: rgb(73, 75, 76);
              color: rgb(73, 75, 76);
              border-radius: 0;
            }
          }
        }
      }
    }

    &.workspace {
      .panel-tools .title {
        text-transform: uppercase;
      }
      .panel-tools .actions {
        .position-file {
          background-image: url(../../assets/images/positioning.svg);
        }
        .create-file {
          background-image: url(../../assets/images/vscode-icons/dark/new-file.svg);
        }
        .create-folder {
          background-image: url(../../assets/images/vscode-icons/dark/new-folder.svg);
        }
        .refresh {
          background-image: url(../../assets/images/vscode-icons/dark/refresh.svg);
        }
        .collapse-all {
          background-image: url(../../assets/images/vscode-icons/dark/collapse-all.svg);
        }
      }
      // .panel-content.expanded {
      //   overflow-y: auto;
      //   height: 500px;
      // }
      .workspace-content {
        border-top: 1px solid rgb(37, 37, 38);
        border-bottom: 1px solid rgb(37, 37, 38);
        // margin-bottom: 32px;
        height: calc(100% - #{$panel-tools-height + 2px});
        overflow-y: auto;
        overflow-x: hidden;
        cursor: default;
        #workspace-file-tree {
          cursor: pointer;
          margin-bottom: 64px;
        }
        &::-webkit-scrollbar {
          width: 12px;
          background-color: rgb(37, 37, 38);
        }
        &::-webkit-scrollbar-track {
          background-color: rgb(37, 37, 38);
        }
        &::-webkit-scrollbar-thumb {
          display: none;
          background-color: rgb(73, 75, 76);
        }
        &:hover::-webkit-scrollbar-thumb {
          display: block;
        }
        .simplebar-track {
          &.simplebar-vertical {
            width: 10px;
          }
          .simplebar-scrollbar {
            width: 10px;
            right: 0;
            &:before {
              background-color: rgb(73, 75, 76);
              color: rgb(73, 75, 76);
              border-radius: 0;
              // opacity: 0;
            }
          }
        }
      }
    }

    &.switch-workspace {
      .panel-tools .actions {
        .refresh {
          background-image: url(../../assets/images/vscode-icons/dark/refresh.svg);
        }
      }
      .panel-content.expanded {
        height: 128px;
      }
    }
  }
}

// 控制台顶部工具栏
.console-top-tools {
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 12px;
  width: calc(100% - 24px) !important;

  .console-top-tabs .tab-title{
    cursor: pointer;
    color: rgb(151, 151, 151);
    padding: 6px 2px;
    margin: 0 8px;

    &:hover {
      color: rgb(231, 231, 231);
    }

    &.active {
      padding: 6px 2px 1px 2px;
      margin: 0 8px 4px 8px;
      color: rgb(231, 231, 231);
      border-bottom: 1px solid rgb(65, 65, 65);
    }
  }

  .console-top-buttons {
    color: rgb(204, 204, 204);
    display: flex;
    flex-grow: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    .button {
      cursor: pointer;
      display: inline-block;
      width: 24px;
      height: $editor-tools-height - 4px;
      // background-position-x: 2px;
      background-position: 50%;
      background-repeat: no-repeat;
      background-size: 18px;
      margin: 0 4px;
      &:active {
        background-size: 20px;
      }
    }
    .console-top-expanded-folded {
      background-image: url(../../assets/images/vscode-icons/dark/chevron-up.svg);
      &.expanded {
        background-image: url(../../assets/images/vscode-icons/dark/chevron-up.svg);
      }
      &.folded {
        background-image: url(../../assets/images/vscode-icons/dark/chevron-down.svg);
      }
    }
    .console-top-close {
      background-image: url(../../assets/images/vscode-icons/dark/close.svg);
    }
    .log-filter {
      cursor: pointer;
      font-size: 12px;
      font-weight: bold;
      margin: 0 4px;
      width: 100px;
      height: $editor-tools-height - 12px;
      background-color: rgb(60, 60, 60);
      color: rgb(240, 240, 240);
      border-color: rgb(60, 60, 60);
      &:focus {
        outline-color: rgba(14, 99, 156, 0.8);
        outline-width: 1px;
        outline-style: solid;
        outline-offset: -1px;
        opacity: 1!important;
      }
    }
  }
}

// 控制台侧边工具栏
.v-console-tools {
  overflow: hidden;
  color: rgb(204, 204, 204);
  padding: 0 0 12px 0;
  height: calc(100% - 12px) !important;

  .button {
    cursor: pointer;
    margin-top: 10px;
    margin-right: 3px;
    height: $editor-tools-height - 12px;
    border-radius: 3px;
    background-position: 50%;
    background-repeat: no-repeat;
    background-size: 18px;
    &:hover {
      background-color: rgb(60, 63, 65);
    }
    &.active {
      background-color: rgb(60, 63, 65);
    }
    &:active {
      background-size: 20px;
    }
  }

  .follow-log {
    background-image: url(../../assets/images/vscode-icons/dark/desktop-download.svg);
    &:hover {
      background-color: rgb(30, 30, 30);
    }
    &.active:hover{
      background-color: rgb(60, 63, 65);
    }
  }
  .clear-log {
    background-image: url(../../assets/images/vscode-icons/dark/clear-all.svg);
  }
  .disconnect {
    background-image: url(../../assets/images/vscode-icons/dark/disconnect-.svg);
  }
}

// 编辑文件页签
.editor-tools {
  overflow: hidden;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  padding: 0 12px 0 0;
  width: calc(100% - 12px) !important;

  .open-file-tabs {
    font-size: 0;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    .file-title{
      cursor: pointer;
      display: inline-block;
      height: $editor-tools-height - 1px;
      color: rgba(255, 255, 255, 0.5);
      background-color: rgb(45, 45, 45);
      border-right: 1px solid rgb(25, 25, 25);

      .file-type {
        display: inline-block;
        margin: 9px 5px 0 12px;
        width: 16px;
        height: 16px;
        background-position: 50%;
        background-repeat: no-repeat;
        vertical-align: bottom;
        &.file-type-js {
          background-image: url(../../assets/images/vscode-icons/folder-file-type/file_type_js.svg);
        }
        &.file-type-json {
          background-image: url(../../assets/images/vscode-icons/folder-file-type/file_type_json.svg);
        }
      }
      .file-name {
        display: inline-block;
        vertical-align: bottom;
        display: inline-block;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        font-size: 12px;
        font-weight: bold;
        font-family:"Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif;
        max-width: 120px;
      }
      .file-close {
        display: inline-block;
        width: 16px;
        height: 16px;
        margin: 0 12px 0 6px;
        background-position: 50%;
        background-repeat: no-repeat;
        vertical-align: bottom;
        &:active {
          background-size: 20px;
        }
        &.need-save {
          background-image: url(../../assets/images/vscode-icons/dark/circle-filled.svg) !important;
        }
      }
      &:hover .file-close {
        background-image: url(../../assets/images/vscode-icons/dark/close.svg);
      }
      &.active {
        color: rgb(255, 255, 255);
        background-color: rgb(30, 30, 30);
        .file-close {
          background-image: url(../../assets/images/vscode-icons/dark/close.svg);
        }
      }
    }
  }

  .editor-tools-buttons {
    color: rgb(204, 204, 204);
    display: flex;
    flex-grow: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;

    .button {
      cursor: pointer;
      display: inline-block;
      width: 24px;
      height: $editor-tools-height - 4px;
      background-position: 50%;
      background-repeat: no-repeat;
      background-size: 18px;
      margin: 0 4px;
      &:active {
        background-size: 20px;
      }
    }

    // .close-all-file {
    //   background-image: url(../../assets/images/vscode-icons/dark/close-all.svg);
    // }
    .delete-file {
      background-image: url(../../assets/images/vscode-icons/dark/trash.svg);
    }
    .lock-file {
      background-image: url(../../assets/images/vscode-icons/dark/lock.svg);
      &.unlock {
        background-image: url(../../assets/images/vscode-icons/dark/unlock.svg);
      }
    }
    .save-file {
      background-image: url(../../assets/images/vscode-icons/dark/save.svg);
    }
  }
}

// 顶部工具栏
.workbench-header {
  overflow: hidden;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  padding: 0 12px;
  width: calc(100% - 24px) !important;
  .open-file-full-path {
    display: inline-block;
    display: inline-block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: rgba(204, 204, 204, 0.8);
    padding-bottom: 3px;
    .workspace-title {
      display: inline-block;
      font-size: 14px;
      font-weight: 450;
    }
    .file-full-path-title {
      display: inline-block;
      margin-left: 16px;
      font-size: 0;
      .path-title {
        cursor: pointer;
        display: inline-block;
        font-size: 14px;
        font-weight: 450;
        &:hover {
          color: rgba(255, 255, 255, 0.9);
        }
      }
      .path-separate {
        display: inline-block;
        width: 16px;
        height: 12px;
        background-position-x: 50%;
        background-repeat: no-repeat;
        background-size: 14px;
        background-image: url(../../assets/images/vscode-icons/dark/chevron-right.svg);
      }
    }
  }

  .workbench-header-tools {
    display: flex;
    flex-grow: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;

    .button {
      cursor: pointer;
      display: inline-block;
      width: 24px;
      height: $editor-tools-height - 4px;
      background-position: 50%;
      background-repeat: no-repeat;
      background-size: 18px;
      margin: 0 4px;
      &:hover {
        background-color: rgb(30, 30, 30);
      }
    }
    .fa-button {
      display: inline-block;
      cursor: pointer;
      font-size: 16px;
      color: rgb(197, 197, 197);
      // width: 24px;
      padding: 6px 5px;
      margin: 0 4px;
      &:hover {
        color: rgb(233, 233, 233);
        background-color: rgb(30, 30, 30);
      }
      &.debug.fa-bug {
        color: rgb(73, 156, 84) !important;
      }
      &.debug.fa-stop {
        color: rgb(199, 84, 80) !important;
      }
    }
    .console {
      background-size: 16px;
      background-image: url(../../assets/images/vscode-icons/dark/console.svg);
    }
    .listener-logs {
      background-image: url(../../assets/images/vscode-icons/dark/vm-running.svg);
      &.stop {
        background-image: url(../../assets/images/stop.svg);
        // background-image: url(../../assets/images/vscode-icons/dark/disconnect.svg);
      }
    }
    .select-method {
      cursor: pointer;
      font-size: 12px;
      font-weight: bold;
      margin: 0 4px;
      min-width: 110px;
      max-width: 280px;
      height: $editor-tools-height - 14px;
      background-color: rgb(37, 37, 38);
      color: rgb(240, 240, 240);
      border-color: rgb(90, 90, 90);
      &:focus {
        outline-color: rgba(14, 99, 156, 0.8);
        outline-width: 1px;
        outline-style: solid;
        outline-offset: -1px;
        opacity: 1!important;
      }
    }
  }
}





